import React from 'react'
import { observer, inject } from 'mobx-react'
import './loadingPop.scss'

@inject('UserStore')
@observer
class Loading extends React.Component {
  constructor(props) {
    super()
    this.state = {}
  }
  componentDidMount() {
    this.setTimer()
  }
  componentWillMount() {
    // clearTimeout(this.timer)
  }

  setTimer() {
    let _this = this
    _this.timer = setTimeout(() => {
      _this.props.UserStore.setErrorMsg(false, '')
    }, 3000)
  }
  render() {
    const { postOrGetDataMsg } = this.props.UserStore

    function createMarkup() {
      return { __html: postOrGetDataMsg }
    }
    return (
      <div>
        <div className="error-pop-page">
          <div className="loading-pop-bkg" />
          <div className="loading-pop-dec">
            <img
              className="loading-img"
              src={require('../../static/upload/loading-11.gif')}
              alt=""
            />
            {/* <span
              className="dec-main"
              dangerouslySetInnerHTML={createMarkup()}
            /> */}
          </div>
        </div>
      </div>
    )
  }
}

export default Loading
